﻿Public Class MusteriGecisSummary
    Inherits System.Web.UI.Page
    Dim pin_customer_id As Integer
    Dim pin_co_id As Integer

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Convert.ToInt32(Session("secim")) = 1 Then
            'dt2 = ccapps.persistent.YenidenAktivasyon.SMECustCodeSearch(custcode) 
            Label18.Text = "Yeniden Aktivasyon İşlem Sonucu "
        ElseIf Convert.ToInt32(Session("secim")) = 2 Then
            'dt2 = ccapps.persistent.Gpo2Gpo.SMECustCodeSearch(custcode)
            Label18.Text = "Gpo2Gpo İşlem Sonucu "
        ElseIf Convert.ToInt32(Session("secim")) = 3 Then
            'dt2 = ccapps.persistent.GPO2Avea.SMECustCodeSearch(custcode)
            Label18.Text = "Gpo2Avea İşlem Sonucu "
        ElseIf Convert.ToInt32(Session("secim")) = 4 Then
            'dt2 = ccapps.persistent.Avea2GPO.SMECustCodeSearch(custcode)
            Label18.Text = "Avea2Gpo İşlem Sonucu "
        ElseIf Convert.ToInt32(Session("secim")) = 5 Then
            Label18.Text = "Devir İşlem Sonucu "
        End If

        If Session("user") = "" Or Session("user") Is Nothing Then
            Session("message") = "!!Session Timeout!!,Tekrar Giriş Yapmalısınız"
            Response.Clear()
            Response.Status = "302 Object Moved"
            Response.RedirectLocation = "CX_Exception.aspx"
            Response.End()
        End If
        Label16.Text = Session("customer_id")
        Label16.Visible = False
        pin_customer_id = Convert.ToInt32(Label16.Text)
        Label17.Text = Session("co_id")
        pin_co_id = Convert.ToInt32(Label17.Text)
        Label11.Text = Session("sim")
        Label1.Text = Session("msisdn")
        Label14.Text = Session("rscode")
        CustcodeLabel()
        CustomerInfoLabel()
        RatePlanLabel()
        DealerInfoLabel()

    End Sub

    Private Sub CustcodeLabel()



        'Dim dt3 As DataTable = GetCustomerCode(pin_customer_id)
        Dim dt3 As DataTable = New DataTable()

        If Convert.ToInt32(Session("secim")) = 1 Then
            dt3 = ccapps.persistent.YenidenAktivasyon.GetCustomerCode(pin_customer_id)

        ElseIf Convert.ToInt32(Session("secim")) = 2 Then
            dt3 = ccapps.persistent.Gpo2Gpo.GetCustomerCode(pin_customer_id)

        ElseIf Convert.ToInt32(Session("secim")) = 3 Then
            dt3 = ccapps.persistent.GPO2Avea.GetCustomerCode(pin_customer_id)

        ElseIf Convert.ToInt32(Session("secim")) = 4 Then
            dt3 = ccapps.persistent.Avea2GPO.GetCustomerCode(pin_customer_id)
        ElseIf Convert.ToInt32(Session("secim")) = 5 Then
            dt3 = ccapps.persistent.CustomerCreate.GetCustomerCode(pin_customer_id)

        End If

        If dt3.Rows.Count > 0 Then
            For Each dr3 As DataRow In dt3.Rows
                CustomerCode.Text = dr3("custcode").ToString()



            Next
        End If
    End Sub

    Private Sub CustomerInfoLabel()



        'Dim dt3 As DataTable = GetCustomerInfo(pin_customer_id)
        Dim dt3 As DataTable = New DataTable()

        If Convert.ToInt32(Session("secim")) = 1 Then
            dt3 = ccapps.persistent.YenidenAktivasyon.GetCustomerInfo(pin_customer_id)

        ElseIf Convert.ToInt32(Session("secim")) = 2 Then
            dt3 = ccapps.persistent.Gpo2Gpo.GetCustomerInfo(pin_customer_id)

        ElseIf Convert.ToInt32(Session("secim")) = 3 Then
            dt3 = ccapps.persistent.GPO2Avea.GetCustomerInfo(pin_customer_id)

        ElseIf Convert.ToInt32(Session("secim")) = 4 Then
            dt3 = ccapps.persistent.Avea2GPO.GetCustomerInfo(pin_customer_id)
        ElseIf Convert.ToInt32(Session("secim")) = 5 Then
            dt3 = ccapps.persistent.CustomerCreate.GetCustomerInfo(pin_customer_id)

        End If

        If dt3.Rows.Count > 0 Then
            For Each dr3 As DataRow In dt3.Rows
                CustomerInfo.Text = dr3("ccname").ToString() & "  " & dr3("ccfname").ToString() & "  " & dr3("cclname").ToString() & "  " & dr3("ccaddr1").ToString() & "  " & dr3("ccaddr2").ToString() & "  " & dr3("CCCITY").ToString()



            Next
        End If
    End Sub

    Private Sub RatePlanLabel()



        'Dim dt3 As DataTable = GetRatePlan(pin_co_id)

        Dim dt3 As DataTable = New DataTable()

        If Convert.ToInt32(Session("secim")) = 1 Then
            dt3 = ccapps.persistent.YenidenAktivasyon.GetRatePlan(pin_co_id)

        ElseIf Convert.ToInt32(Session("secim")) = 2 Then
            dt3 = ccapps.persistent.Gpo2Gpo.GetRatePlan(pin_co_id)

        ElseIf Convert.ToInt32(Session("secim")) = 3 Then
            dt3 = ccapps.persistent.GPO2Avea.GetRatePlan(pin_co_id)

        ElseIf Convert.ToInt32(Session("secim")) = 4 Then
            dt3 = ccapps.persistent.Avea2GPO.GetRatePlan(pin_co_id)
        ElseIf Convert.ToInt32(Session("secim")) = 5 Then
            dt3 = ccapps.persistent.CustomerCreate.GetRatePlan(pin_co_id)

        End If

        If dt3.Rows.Count > 0 Then
            For Each dr3 As DataRow In dt3.Rows
                Label13.Text = dr3("des").ToString()



            Next
        End If
    End Sub

    Private Sub DealerInfoLabel()

        Dim serialnum As String = Label11.Text


        'Dim dt3 As DataTable = GetDealerInfo(serialnum)
        Dim dt3 As DataTable = New DataTable()

        If Convert.ToInt32(Session("secim")) = 1 Then
            dt3 = ccapps.persistent.YenidenAktivasyon.GetDealerInfo(serialnum)

        ElseIf Convert.ToInt32(Session("secim")) = 2 Then
            dt3 = ccapps.persistent.Gpo2Gpo.GetDealerInfo(serialnum)

        ElseIf Convert.ToInt32(Session("secim")) = 3 Then
            dt3 = ccapps.persistent.GPO2Avea.GetDealerInfo(serialnum)

        ElseIf Convert.ToInt32(Session("secim")) = 4 Then
            dt3 = ccapps.persistent.Avea2GPO.GetDealerInfo(serialnum)
        ElseIf Convert.ToInt32(Session("secim")) = 5 Then
            dt3 = ccapps.persistent.CustomerCreate.GetDealerInfo(serialnum)

        End If

        If dt3.Rows.Count > 0 Then
            For Each dr3 As DataRow In dt3.Rows
                lblDealerInfo.Text = dr3("CCFNAME").ToString() + ", " + dr3("CCLNAME").ToString() + ", " + dr3("CCCITY").ToString()



            Next
        End If
    End Sub

End Class